from dotenv import load_dotenv
import os

# 根据环境变量加载不同的 .env 文件
env = os.getenv("ENV", "development")  # 默认加载开发环境
env_file = ".env.production" if env == "production" else ".env"
load_dotenv(env_file)

# 从环境变量中读取配置
SQLALCHEMY_DATABASE_URI = os.getenv("SQLALCHEMY_DATABASE_URI")
DEBUG = os.getenv("DEBUG", "False").lower() == "true"
SECRET_KEY = os.getenv("SECRET_KEY")
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "").split(",")

